<template>
  <div v-html="iframeHtml">iframe 数据加载失败</div>
</template>

<script>
import { msgTemplateDetailApi } from "api/dataCenter.js";
export default {
  name: "msgTemplatePreview",
  data() {
    return {
      iframeHtml: "",
      templateId: "",
    };
  },
  watch: {
    // iframeHtml: {
    //   deep: true,
    //   immediate: true,
    //   handler(newVal) {
    //     console.log("iframeHtml newVal >>>", newVal);
    //   },
    // },
  },
  methods: {
    initData() {
      this.templateId = this.$route.query.id;
      msgTemplateDetailApi({
        id: this.templateId,
      }).then((res) => {
        if (res.data) {
          let { content, createTime, creator } = res.data;
          this.iframeHtml = content;
        }
      });
    },
  },
  mounted() {
    this.initData();
  },
};
</script>

<style>
* {
  pointer-events: none;
}
</style>
